﻿//
// $HeadURL: http://codeka-memcache.googlecode.com/svn/trunk/Codeka.Memcache/StoreResult.cs $
// $Revision: 10 $
// $Author: dean.codeka $     $Date: 2010-02-21 06:05:46 +0000 (Sun, 21 Feb 2010) $
//
// Copyright © 2009-2010 Dean Harding, all rights reserved.
//


namespace Codeka.Memcache
{
    /// <summary>
    /// These are the possible results we'll return from a store operation. There is not
    /// "success" because we don't actually return any for "success".
    /// </summary>
    public enum StoreResult
    {
        /// <summary>
        /// This is returned by the methods which only return one result. For the methods
        /// that return an <see cref="IDictionary{TKey,TValue}"/> of key-&gt;<see cref="StoreResult"/>,
        /// this value will never be in that list.
        /// </summary>
        Success,

        /// <summary>
        /// If you tried to store with <b>StoreMode.Add</b>, then we'll return this
        /// if the value already exists.
        /// </summary>
        ItemAlreadyExists,

        /// <summary>
        /// If you tried to store with <b>StoreMode.Replace</b>, then we'll return this
        /// if the value does not exist.
        /// </summary>
        ItemDoesNotExist,

        /// <summary>
        /// If you pass a check-and-set value, and it's different to the one that's already
        /// there, this is what we'll return.
        /// </summary>
        CasValueDifferent,

        /// <summary>
        /// An unknown error has occured trying to store the value (we try not to throw exceptions,
        /// since it's just caching...)
        /// </summary>
        UnknownError,
    }
}
